//
// Created by long_ on 2021/9/14.
//

#ifndef INTERFACE_PLUGIN_AUDIO_TAGS_H
#define INTERFACE_PLUGIN_AUDIO_TAGS_H

#include <cstdint>

namespace OHOS {
namespace Multimedia {
namespace Plugin {
enum AudioChannelMasks : uint64_t {
    FRONT_LEFT                  = 1ULL << 0U,
    FRONT_RIGHT                 = 1ULL << 1U,
    FRONT_CENTER                = 1ULL << 2U,
    LOW_FREQUENCY               = 1ULL << 3U,
    BACK_LEFT                   = 1ULL << 4U,
    BACK_RIGHT                  = 1ULL << 5U,
    FRONT_LEFT_OF_CENTER        = 1ULL << 6U,
    FRONT_RIGHT_OF_CENTER       = 1ULL << 7U,
    BACK_CENTER                 = 1ULL << 8U,
    SIDE_LEFT                   = 1ULL << 9U,
    SIDE_RIGHT                  = 1ULL << 10U,
    TOP_CENTER                  = 1ULL << 11U,
    TOP_FRONT_LEFT              = 1ULL << 12U,
    TOP_FRONT_CENTER            = 1ULL << 13U,
    TOP_FRONT_RIGHT             = 1ULL << 14U,
    TOP_BACK_LEFT               = 1ULL << 15U,
    TOP_BACK_CENTER             = 1ULL << 16U,
    TOP_BACK_RIGHT              = 1ULL << 17U,
    STEREO_LEFT                 = 1ULL << 29U,
    STEREO_RIGHT                = 1ULL << 30U,
    WIDE_LEFT                   = 1ULL << 31U,
    WIDE_RIGHT                  = 1ULL << 32U,
};

enum struct AudioChannelLayout : uint64_t {
    MONO                        = (AudioChannelMasks::FRONT_CENTER),
    STEREO                      = (AudioChannelMasks::FRONT_LEFT | AudioChannelMasks::FRONT_RIGHT),
    CH_2POINT1                  = (STEREO | AudioChannelMasks::LOW_FREQUENCY),
    CH_2_1                      = (STEREO | AudioChannelMasks::BACK_CENTER),
    SURROUND                    = (STEREO | AudioChannelMasks::FRONT_CENTER),
    CH_3POINT1                  = (SURROUND | AudioChannelMasks::LOW_FREQUENCY),
    CH_4POINT0                  = (SURROUND | AudioChannelMasks::BACK_CENTER),
    CH_4POINT1                  = (CH_4POINT0 | AudioChannelMasks::LOW_FREQUENCY),
    CH_2_2                      = (STEREO | AudioChannelMasks::SIDE_LEFT | AudioChannelMasks::SIDE_RIGHT),
    QUAD                        = (STEREO | AudioChannelMasks::BACK_LEFT | AudioChannelMasks::BACK_RIGHT),
    CH_5POINT0                  = (SURROUND | AudioChannelMasks::SIDE_LEFT | AudioChannelMasks::SIDE_RIGHT),
    CH_5POINT1                  = (CH_5POINT0 | AudioChannelMasks::LOW_FREQUENCY),
    CH_5POINT0_BACK             = (SURROUND | AudioChannelMasks::BACK_LEFT | AudioChannelMasks::BACK_RIGHT),
    CH_5POINT1_BACK             = (CH_5POINT0_BACK | AudioChannelMasks::LOW_FREQUENCY),
    CH_6POINT0                  = (CH_5POINT0 | AudioChannelMasks::BACK_CENTER),
    CH_6POINT0_FRONT            = (CH_2_2 | AudioChannelMasks::FRONT_LEFT_OF_CENTER |
                                    AudioChannelMasks::FRONT_RIGHT_OF_CENTER),
    HEXAGONAL                   = (CH_5POINT0_BACK | AudioChannelMasks::BACK_CENTER),
    CH_6POINT1                  = (CH_5POINT1 | AudioChannelMasks::BACK_CENTER),
    CH_6POINT1_BACK             = (CH_5POINT1_BACK | AudioChannelMasks::BACK_CENTER),
    CH_6POINT1_FRONT            = (CH_6POINT0_FRONT | AudioChannelMasks::LOW_FREQUENCY),
    CH_7POINT0                  = (CH_5POINT0 | AudioChannelMasks::BACK_LEFT | AudioChannelMasks::BACK_RIGHT),
    CH_7POINT0_FRONT            = (CH_5POINT0 | AudioChannelMasks::FRONT_LEFT_OF_CENTER |
                                    AudioChannelMasks::FRONT_RIGHT_OF_CENTER),
    CH_7POINT1                  = (CH_5POINT1 | AudioChannelMasks::BACK_LEFT | AudioChannelMasks::BACK_RIGHT),
    CH_7POINT1_WIDE             = (CH_5POINT1 | AudioChannelMasks::FRONT_LEFT_OF_CENTER |
                                    AudioChannelMasks::FRONT_RIGHT_OF_CENTER),
    CH_7POINT1_WIDE_BACK        = (CH_5POINT1_BACK | AudioChannelMasks::FRONT_LEFT_OF_CENTER |
                                    AudioChannelMasks::FRONT_RIGHT_OF_CENTER),
    OCTAGONAL                   = (CH_5POINT0 | AudioChannelMasks::BACK_LEFT | AudioChannelMasks::BACK_CENTER |
                                    AudioChannelMasks::BACK_RIGHT),
    HEXADECAGONAL               = (OCTAGONAL | AudioChannelMasks::WIDE_LEFT | AudioChannelMasks::WIDE_RIGHT |
                                    AudioChannelMasks::TOP_BACK_LEFT | AudioChannelMasks::TOP_BACK_RIGHT |
                                    AudioChannelMasks::TOP_BACK_CENTER | AudioChannelMasks::TOP_FRONT_CENTER |
                                    AudioChannelMasks::TOP_FRONT_LEFT | AudioChannelMasks::TOP_FRONT_RIGHT),
    STEREO_DOWNMIX               = (AudioChannelMasks::STEREO_LEFT | AudioChannelMasks::SIDE_RIGHT)
};

enum struct AudioSampleFormat : uint8_t {
    S8, U8, S8P, U8P,
    S16, U16, S16P, U16P,
    S32, U32, S32P, U32P,
    S64, U64, S64P, U64P,
    F32, F32P, F64, F64P,
};

enum struct AudioAacProfile : uint8_t {
    NONE = 0,
    MAIN = 1,
    LC,
    SSR,
    LTP,
    HE,
    Scalable,
    ERLC = 17,
    ER_Scalable = 20,
    LD = 23,
    HE_PS = 29,
    ELD = 39,
    XHE = 42,
};

enum struct AudioAacStreamFormat : uint8_t  {
    MP2ADTS = 0,
    MP4ADTS,
    MP4LOAS,
    MP4LATM,
    ADIF,
    MP4FF,
    RAW,
};

}
}
}
#endif //INTERFACE_PLUGIN_AUDIO_TAGS_H
